package de.schoar.nagroid.nagios;



public class NagiosService {
	private NagiosHost mHost;
	private String mServiceName;
	private NagiosState mState;
	private String mduration;

	public NagiosService(NagiosHost host, String servicename, NagiosState state) {
		mHost = host;
		mServiceName = servicename;
		mState = state;
		mduration = null;
		host.addChild(this);
	}

	
	public NagiosService(String servicename, NagiosState state) {
		mServiceName = servicename;
		mState = state;
		mduration = null;
	}
	
	public NagiosService(String servicename) {
		mServiceName = servicename;
		mduration = null;
	}
	
	// state, info, attempt, lastcheck, age, last state change, current state
	// duration, is downtime,
	// notifications

	public NagiosState getmState() {
		return mState;
	}

	public void setmState(NagiosState mState) {
		this.mState = mState;
	}

	public String getMduration() {
		return mduration;
	}

	public void setMduration(String mduration) {
		this.mduration = mduration;
	}

	@Override
	public String toString() {
		return ("Service: " + mServiceName + " State: " + mState);
	}

	public NagiosHost getHost() {
		return mHost;
	}

	public String getName() {
		return mServiceName;
	}

	public NagiosState getState() {
		return mState;
	}
		
}

